package com.rrd.itext.xmlBean.layoutBean;

import java.util.ArrayList;
import java.util.List;

import com.itextpdf.text.pdf.PdfContentByte;
import com.itextpdf.text.pdf.PdfPCell;
import com.rrd.itext.utils.PDFBuilder;
import com.rrd.itext.xmlBean.layoutBean.iface.PdfElementParser;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;

@XStreamAlias("Tr")
public class XmlTr implements  PdfElementParser<Object>{
	@XStreamAlias("tds")
	private List<XmlTd> tds;
	@XStreamAsAttribute
	@XStreamAlias("name")
	private String name;

	public List<XmlTd> getTds() {
		return tds;
	}

	public void setTds(List<XmlTd> tds) {
		this.tds = tds;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	 @Override
	 public List<PdfPCell> parse(PDFBuilder builder) throws Exception
	 {
	  List<XmlTd> tds = this.getTds();
	  List<PdfPCell> list = new ArrayList<PdfPCell>();
	  for(XmlTd td : tds)
	  {
	  list.add(td.parse(builder));
	  }
	  return list;
	 }



}
